% Test the functions makeppftfilter and applyppftfilter against the
% preconditioned PPFT.
%
% Yoel Shkolnisky, December 2010.
explim=3;
for n=2.^(1:explim)
	precision='double';
	if n > 2^(explim-1)
		precision='single';
	end
    A=rand(n,n,n);
    tic;
    B=preconditionedAdjointPPFT3D(optimizedPPFT3D(A,precision),precision);
    t1=toc;
    
    H=calculatePreconditioner3D(n,1,precision);
    L=3*n-2;
    Hhat=fftn(H.filter,[L L L]);
    tic;
    C=applyHFilter3D(A,Hhat);
    t2=toc;

    err=norm(B(:)-C(:))./norm(B(:));    
    reportTestResult(n,err,t1/t2,precision);
end
